FROM php:7.4-fpm
RUN cp /etc/apt/sources.list /etc/apt/sources.copy.list \
    && echo "deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free" > /etc/apt/sources.list \
    && echo "deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free" >> /etc/apt/sources.list \
    && echo "deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free" >> /etc/apt/sources.list \
    && echo "deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free" >> /etc/apt/sources.list \
    && apt update \
    && docker-php-ext-install pdo_mysql \
    && apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev libmcrypt-dev\
    && docker-php-source extract \
    && cd /usr/src/php/ext/gd \
    && docker-php-ext-configure gd \
    --with-webp=/usr/include/webp/ \
    --with-freetype=/usr/include/freetype2 \
    --with-jpeg=/usr/include/ \
    && docker-php-ext-install gd \
    && pecl install yaf \
    && docker-php-ext-enable yaf \
    # && pecl download redis \
    && curl 'http://pecl.php.net/get/redis-5.3.7.tgz' -o redis-5.3.7.tgz \
    && printf "\n" | pecl install redis-5.3.7.tgz \
    # && tar -zxvf redis-5.3.7.tgz \
    # && mkdir /usr/src/php/redis/ext \
    # && cp -r redis-5.3.7/. /usr/src/php/ext/redis \
    && apt-get install -y libzip-dev \
    && docker-php-ext-install zip \
    && docker-php-ext-enable redis \
    && printf "\n" | pecl install mcrypt \
    && docker-php-ext-enable mcrypt \
    && apt-get install openssl libssl-dev libcurl4-openssl-dev libc-ares-dev\
    && pecl install -D 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes" enable-cares="yes"' swoole-4.8.13 \
    && docker-php-ext-enable swoole

MAINTAINER chen
